<?php

// +----------------------------------------------------------------------

// | ThinkPHP [ WE CAN DO IT JUST THINK ]

// +----------------------------------------------------------------------

// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.

// +----------------------------------------------------------------------

// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )

// +----------------------------------------------------------------------

// | Author: liu21st <liu21st@gmail.com>

// +----------------------------------------------------------------------

use think\facade\Route;



//小程序

Route::group(function (){

    //不需要验证登录

    Route::group(function (){

        Route::rule('miniapp/init','miniapp.Main/init');

        Route::rule('miniapp/passport','miniapp.Main/passport');

        Route::rule('miniapp/showShopDetail','miniapp.Main/showShopDetail');

        Route::rule('miniapp/getBalancePackage','miniapp.member.Member/getBalancePackage');//获取充值套餐



        //小程序推荐

        Route::rule('miniapp/getRecommendMiniapps','miniapp.Main/getRecommendMiniapps');

        Route::rule('miniapp/getCouponDatas','miniapp.member.Coupon/getCouponDatas');

    })->middleware(\app\base\middleware\MiniappCheck::class);

    

    //订单下单

    Route::group(function (){

        Route::rule('miniapp/getBalancePayment','miniapp.payment/getBalancePayment');//充值调起微信支付        

        Route::rule('miniapp/getBuyPayment','miniapp.payment/getBuyPayment'); //买单调起微信支付

        

    })->middleware([\app\base\middleware\MiniappCheck::class,\app\base\middleware\MemberCheck::class]);

    //订单回调

    Route::group(function (){

        Route::rule('miniapp/balanceRespond/:shop_id','miniapp.payment/balanceRespond');//充值回调

        Route::rule('miniapp/buyRespond/:shop_id','miniapp.payment/buyRespond');//买单支付回调

    })->middleware(\app\base\middleware\MiniappCheck::class);

    

    //需要验证登录（用户）

    Route::group(function (){

        

        Route::rule('miniapp/getBuyInit','miniapp.member.buy/init');//买单的初始化

        Route::rule('miniapp/getBuyCreateOrder','miniapp.member.buy/buyCreateOrder');//下优惠买单订单

        Route::rule('miniapp/getBuyMoneyPayment','miniapp.member.buy/buyMoneyPayment');//余额支付买单

       

        Route::rule('miniapp/getMemberInfo','miniapp.member.Member/show');

        Route::rule('miniapp/getMemberQrcode','miniapp.member.Member/getMemberQrcode');

        Route::rule('miniapp/saveMemberInfo','miniapp.member.Member/saveMemberInfo');



        Route::rule('miniapp/getCoupon','miniapp.member.Coupon/getCoupon');//领取优惠券

        Route::rule('miniapp/getMemberCoupons','miniapp.member.Coupon/getMemberCoupons');//获取我的优惠券



        Route::rule('miniapp/getMemberBalanceLogs','miniapp.member.Member/getMemberBalanceLogs');//余额明细

       

        Route::rule('miniapp/getMemberIntegralLogs','miniapp.member.Member/getMemberIntegralLogs');//积分明细

        Route::rule('miniapp/getExchangeCouponDatas','miniapp.member.Coupon/getExchangeCouponDatas');//可兑换的优惠券

        Route::rule('miniapp/exchangeCoupon','miniapp.member.Coupon/exchangeCoupon');//兑换优惠券



        Route::rule('miniapp/getMemberBuyLogs','miniapp.member.Member/getMemberBuyLogs');//买单记录

    })->middleware([\app\base\middleware\MiniappCheck::class,\app\base\middleware\MemberCheck::class]);



    //员工

    Route::group(function (){

        Route::rule('miniapp/staff/getStaffInfo','miniapp.staff.Main/getStaffInfo');//获取员工信息

        Route::rule('miniapp/staff/getSearchMemeberId','miniapp.staff.Main/getSearchMemeberId');//获取员工信息

        Route::rule('miniapp/staff/scanCheckMember','miniapp.staff.Main/scanCheckMember');//扫码确认

        Route::rule('miniapp/staff/applyVip','miniapp.staff.Main/applyVip');//办理会员



        //会员详情

        Route::rule('miniapp/staff/getMemberInfo','miniapp.staff.Member/getMemberInfo');//获取会员信息

        Route::rule('miniapp/staff/balanceRecharge','miniapp.staff.Member/balanceRecharge');//余额充值

        Route::rule('miniapp/staff/writeOffBalance','miniapp.staff.Member/writeOffBalance');//余额核销

        Route::rule('miniapp/staff/integralRecharge','miniapp.staff.Member/integralRecharge');//积分充值

        Route::rule('miniapp/staff/writeOffIntegral','miniapp.staff.Member/writeOffIntegral');//积分核销

        Route::rule('miniapp/staff/chooseCoupon','miniapp.staff.Member/chooseCoupon');//获取可赠送的优惠券

        Route::rule('miniapp/staff/sendCoupon','miniapp.staff.Member/sendCoupon');//赠送优惠券

        Route::rule('miniapp/staff/getMemberCouponList','miniapp.staff.Member/getMemberCouponList');//获取用户优惠券

        Route::rule('miniapp/staff/writeOffCoupon','miniapp.staff.Member/writeOffCoupon');//核销优惠券



        Route::rule('miniapp/staff/getMemberLogsList','miniapp.staff.Member/getMemberLogsList');//会员记录



    })->middleware([\app\base\middleware\MiniappCheck::class,\app\base\middleware\MemberCheck::class,\app\base\middleware\StaffCheck::class]);





})->middleware(\app\base\middleware\Base::class);